<!--招聘信息查看组件-->
<template>
  <div class="Home">
    <div class="rightmain">
      <div class="top"><h1>招聘信息查阅</h1></div>
      <div class="rightmainbody">
        <!-- <div class="top"><h1>招聘信息查阅</h1></div> -->
        <el-form ref="editFormRef" :model="submitInfo" label-width="100px">
          <el-form-item label="职位名称：">
            <el-input v-model="submitInfo.title" />
          </el-form-item>
          <el-form-item label="发布时间：">
            <el-input v-model="submitInfo.releaseTime" />
          </el-form-item>
          <el-form-item label="职位详情：" style="margin-bottom:0px;"></el-form-item>
        </el-form>
      </div>
      <div class="rightmiddle">
        <div id="editor">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import E from "wangeditor";
export default {
  name: "seeRecruitment",
  data() {
    return {
      submitInfo:{}
    };
  },
  mounted() {
    this.getData()
    this.getEditor()
  },
  methods:{
    async getData() {
      const that = this
      this.allData = that.$route.query.info
      const {data: res} = await this.$http.get('recruit/' + that.$route.query.info.id)
      this.submitInfo = JSON.parse(JSON.stringify(res.data[0]))
      console.log(res)
    },
    getEditor(){
      var that=this
      this.$http.get('recruit/' + that.$route.query.info.id).then(({data: res}) => {
                this.submitInfo = res.data[0]
                this.editor.txt.html(this.submitInfo.content)      
        })
      this.editor = new E("#editor");
      // 把富文本编制器的内容传给subitInfo对象的content元素
      this.editor.customConfig.onchange = function (text) {
      };
      this.editor.create();
      this.editor.customConfig.uploadImgServer =
        "http://dl.sword.ink:2334/upload/picture";
      //必要设置，值必须为“myfiles”
      this.editor.customConfig.uploadFileName = "myfiles";
      // 图片最大体积为20MB
      this.editor.customConfig.uploadImgMaxSize = 20 * 1024 * 1024;
      //超时时间要设置长一点，否则大图片上传可能失败，默认为10秒，这里设置为30秒
      this.editor.customConfig.uploadImgTimeout = 30000;
      this.editor.txt.html("'" + this.submitInfo.content + "'")
    },
  },
};
</script>


<style scoped>
* {
  margin: 0;
  padding: 0;
}
.el-input__inner {
  height: 30px;
  background: #ffffff;
  border: 1px solid #777777;
  box-sizing: border-box;
  border-radius: 0px;
}
.Home {
  height: 80vh;
  width: 80vw;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  align-items: flex-end;
  overflow: scroll;
}
::-webkit-scrollbar {display:none}
.top{
  width: 100%;
  height: auto;
  text-align: center;
}
.top h1{
  margin-top: 15px;
  margin-bottom: 0px;
  font-size: 25px;
  font-family: '宋体';
}
.rightmain {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #777777;
  width: 100%;
  height: 100%;
}
.rightmainbody {
  /* border: 1px solid #777777; */
  box-sizing: border-box;
  width: 50%;
  height: 25%;
  margin-left: 10%;
  margin-top: 3%;
}
.rightmaintext {
  display: flex;
  justify-content: flex-start;
  background: #ffffff;
  /* border: 1px solid #777777; */

  width: 100%;
  height: 31%;
}
.rightmaintextleft {
  background: #ffffff;
  font-size: 2.5vh;
  font-family: Microsoft YaHei, Microsoft YaHei-Normal;
  font-weight: Normal;
  text-align: left;
  color: #777777;
  /* border: 1px solid #a58f8f; */
  box-sizing: border-box;
  width: 20%;
  height: 100%;
}
.rightmaintextright {
  /* margin-top: 1%; */
  background: #ffffff;
  /* border: 1px solid #777777; */
  box-sizing: border-box;
  margin-left: 8%;
  width: 60%;
  height: 80%;
}
.rightmiddle {
  min-width: 700px;
  width: 80%;
  height: 60%;
  margin-left: 10%;
  background: #ffffff;
  box-sizing: border-box;
  font-size: 2.5vh;
  font-family: Microsoft YaHei, Microsoft YaHei-Normal;
  font-weight: Normal;
  text-align: left;
  color: #777777;
  /* line-height: 20px; */
}
.rightmiddle /deep/ .w-e-text-container {
  height: 163px !important;
}
</style>
